package com.test.burnincash.util_burnin.helper_burnin;

import android.provider.Settings;
import android.text.TextUtils;

import com.test.burnincash.activity_fragment_burnin.base_burnin.BaseApplication_burnin;
import com.test.burnincash.constant_burnin.Constant_burnin;

import org.jetbrains.annotations.NotNull;

public class DeviceHelper_burnin {

    private static class InnerDeviceHelper {
        private static final DeviceHelper_burnin instance = new DeviceHelper_burnin();
    }

    public static DeviceHelper_burnin getInstance() {
        return InnerDeviceHelper.instance;
    }

    @NotNull
    public static String getPackageName() {
        String pckName = BaseApplication_burnin.getApplication_burnin().getPackageName();
        if (TextUtils.isEmpty(pckName)) {
            pckName = Constant_burnin.NAME;
        }
        return pckName;
    }

    @NotNull
    public String getAndroidID() {
        String androidID = Settings.System.getString(BaseApplication_burnin.getApplication_burnin().getContentResolver(), Settings.Secure.ANDROID_ID);
        if (TextUtils.isEmpty(androidID)) {
            return System.currentTimeMillis() + "";
        }
        if (androidID.contains("00000000")) {
            return System.currentTimeMillis() + "";
        }
        return androidID;
    }

}
